package browser;

import br.edu.fvs.principal.R;
import android.app.Activity;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.EditText;

public class ExemploAbrirBrowser extends Activity implements OnClickListener {
  Button botaoOk;
  EditText campoEndereco;
	
	public void onCreate(Bundle icicle) {
		super.onCreate(icicle);
		setContentView(R.layout.form_browser);
		botaoOk = (Button) findViewById(R.id.btLigarew);
		campoEndereco = (EditText) findViewById(R.id.campoNumero);
		botaoOk.setOnClickListener(this);
		
	}
    public void onClick(View arg0){
    	if(arg0==botaoOk){
    		String endereco = campoEndereco.getText().toString();
    		Uri uri = Uri.parse(endereco);
    		Intent intent = new Intent(Intent.ACTION_VIEW, uri);
    		startActivity(intent);
    	}
    }
}
